 <template>
  <div id="abc" class="abc">
    <div class="card1">
      <p><span>姓名：</span><input class="input" type="text" v-model="names"></p>
      <p><span>年龄：</span><input class="input" type="number" v-model="ages"></p>
      <p><span>性别：</span><input class="input" type="text" v-model="sexes"></p>
      <p><span>语文：</span><input class="input" type="number" v-model="Chinese"></p>
      <p><span>数学：</span><input class="input" type="number" v-model="maths"></p>
      <p><span>英语：</span><input class="input" type="number" v-model="English"></p>
      <button @click="Add">添加</button>
    </div>
      <div class="card" v-for="item in data">
          <ul >
              <li>
                  <img :src="item.image"  >
                  <p><span>姓名：</span>{{item.name}}</p>
                  <p><span>年龄：</span>{{item.age}}</p>
                  <p><span>性别：</span>{{item.sex}}</p>
                  <p><span>总分</span>{{item.chinese+item.math+item.english}}</p>
              </li>
          </ul>
          <div v-if="item.chinese>60&&item.math>60&&item.english>60">
              <div class="button"><span>...</span></div>
                  <div class="hide">
                      <div class="hide-content">
                          <span>语文：{{item.chinese}}</span>
                          <span>数学：{{item.math}}</span>
                          <span>英语：{{item.english}}</span>
                      </div>
                  </div>
            </div>
      </div>
  </div>
</template>
<script>
import "../assets/css/1.css"
import {ref,setup,methods} from 'vue';
export default{
  setup(){
   const data=[
                         {img:"../assets/image/1.jpg",name:'张三',age:20,sex:"男",chinese:70,math:80,english:80},
                         {img:"../assets/image/2.jpg",name:'李四',age:20,sex:"男",chinese:90,math:80,english:80},
                         {img:"../assets/image/3.jpg",name:'王五',age:20,sex:"男",chinese:70,math:70,english:80},
                    ]
                    return{
                      data,
                    }
  },
  methods:{
        Add:function(){
              this.data.push({
                image: "image/3.jpg",
                name:this.names,
                age:this.ages,
                sex:this.sexes,
                chinese:this.Chinese,
                math:this.maths,
                english:this.English
              })
        }
      }
  // data(){
  //   return{
  //                   data:[
  //                       {img:"../assets/image/1.jpg",name:'张三',age:20,sex:"男",chinese:70,math:80,english:80},
  //                       {img:"../assets/image/2.jpg",name:'李四',age:20,sex:"男",chinese:90,math:80,english:80},
  //                       {img:"../assets/image/3.jpg",name:'王五',age:20,sex:"男",chinese:70,math:70,english:80},
  //                   ]
  //               }
  // },
  // methods:{
  //       Add:function(){
  //             this.data.push({
  //               image: "image/3.jpg",
  //               name:this.names,
  //               age:this.ages,
  //               sex:this.sexs,
  //               chinese:this.chineses,
  //               math:this.maths,
  //               english:this.englishs
  //             })
  //       }
  //     }


}
</script>
<style>
.abc{
  display: flex;
  justify-content: center;
  align-self: center;
  margin-left: 20px;
  width: 100%;
  height: 100vh;
  background-image:linear-gradient(200deg,#8bd4e4,#7f8bdb) ;
}
.abc .card1{
  background-color: white;
  width: 300px;
  height: 300px;
  align-self: center;
  border-radius: 10px;
  margin-left: 20px;
}
.abc .card{
  background-color: white;
  width: 200px;
  height: 300px;
  align-self: center;
  border-radius: 10px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.abc p{
  margin-left: 20px;
}
li{
  list-style: none;
}
.abc .button {
width: 200px;
height: 20px;
border-radius: 0px 0px 10px 10px;
background-color: rgba(119, 129, 117, 0.685);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
cursor: pointer;
margin-top: 68px;
}

.abc .button span {
margin-top: -10px;
}
.abc .hide {
background-color: white;
width: 220px;
height: 260px;
position: absolute;
transition: bottom 0.5s;
bottom: -320px;
}

.abc .hide .hide-content {
display: flex;
flex-direction: column;
font-size: 25px;
}

.abc .hide .hide-content span {
padding: 30px;
}

.card:hover .hide {
bottom: 0;
}
.abc img{
  width: 50px;
  border-radius: 50%;
  margin-left: 35%;
}
button{
margin-left: 70%;
}
</style>